package com.sky.backend.utils;

import com.sky.backend.exception.ExceptionEnum;
import com.sky.backend.pojo.Result;

public class ResultUtils {


    public static Result result(Object data) {
        if (data == null) {
            return new Result(ExceptionEnum.SUCCESS.getCode(), ExceptionEnum.SUCCESS.getMsg());
        } else {
            return new Result(ExceptionEnum.SUCCESS.getCode(), ExceptionEnum.SUCCESS.getMsg(), data);
        }
    }
}
